package com.party.core.service.analysis.impl;

import com.party.common.paging.Page;
import com.party.core.dao.read.analysis.StatisticsUserVisitReadDao;
import com.party.core.dao.write.analysis.StatisticsUserVisitWriteDao;
import com.party.core.model.BaseModel;
import com.party.core.model.analysis.StatisticsUserVisit;
import com.party.core.service.analysis.IStatisticsUserVisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @program: party-temp
 * @description: 用户访问_业务接口实现
 * @author: Huaqunhao
 * @create: 2018-08-08 14:01
 **/
@Service
public class StatisticsUserVisitService implements IStatisticsUserVisitService {

    @Autowired
    private StatisticsUserVisitReadDao statisticsUserVisitReadDao;
    @Autowired
    private StatisticsUserVisitWriteDao statisticsUserVisitWriteDao;
    @Override
    public String insert(StatisticsUserVisit statisticsUserVisit) {
        BaseModel.preInsert(statisticsUserVisit);
        boolean result = statisticsUserVisitWriteDao.insert(statisticsUserVisit);
        if (result){
            return statisticsUserVisit.getId();
        }
        return null;
    }

    @Override
    public boolean update(StatisticsUserVisit statisticsUserVisit) {
        statisticsUserVisit.setUpdateDate(new Date());
        return statisticsUserVisitWriteDao.update(statisticsUserVisit);
    }

    @Override
    public boolean deleteLogic(String id) {
        return false;
    }

    @Override
    public boolean delete(String id) {
        return statisticsUserVisitWriteDao.delete(id);
    }

    @Override
    public boolean batchDeleteLogic(Set<String> ids) {
        return false;
    }

    @Override
    public boolean batchDelete(Set<String> ids) {
        return false;
    }

    @Override
    public StatisticsUserVisit get(String id) {
        return statisticsUserVisitReadDao.get(id);
    }

    @Override
    public List<StatisticsUserVisit> listPage(StatisticsUserVisit statisticsUserVisit, Page page) {
        return statisticsUserVisitReadDao.listPage(statisticsUserVisit,page);
    }
    @Override
    public StatisticsUserVisit getBycreateDate(StatisticsUserVisit statisticsUserVisit) {
        return statisticsUserVisitReadDao.getBycreateDate(statisticsUserVisit);
    }

    @Override
    public List<StatisticsUserVisit> batchList(Set<String> ids, StatisticsUserVisit statisticsUserVisit, Page page) {
        return null;
    }

    @Override
    public List<StatisticsUserVisit> list(StatisticsUserVisit statisticsUserVisit) {
        return null;
    }

    @Override
    public StatisticsUserVisit queryByDate(String staDate, String endDate) {
        return statisticsUserVisitReadDao.queryByDate(staDate,endDate);
    }

    @Override
    public List<StatisticsUserVisit> webListPage(Map<String, Object> params, Page page) {
        return statisticsUserVisitReadDao.webListPage(params,page);
    }
}
